<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><{:C('site_name')}></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">

<script type="text/javascript" src="<{:STATICS}>/js/jquery.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/regExp.js"></script>
<script type="text/javascript" src="<{:RES}>/js/common.js"></script>

<link rel="stylesheet" href="<{:STATICS}>/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="<{:STATICS}>/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="<{:RES}>/css/global.css" media="all">
<script>
$(function(){
	//ajaxform
	var options = { 
		dataType:'json',
		beforeSubmit:showRequest,//表单验证方式
        success:showResponse  // post-submit callback 
    }; 

    $('#iframForm').ajaxForm(options); 

    function showResponse(responseText, statusText)  {
    	$('#iframForm button').removeAttr('disabled');
    	$('#iframForm input').removeAttr('disabled');
		if (statusText == 'success') {
			parent.layer.close(load);
			if (responseText.status==1) {
				parent.layer.open({
					type:0, 
					icon:1,
					content:responseText.info,
					time:3000,
					end: function(){ 
						var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
						var _tmp_html = '';		
						data = responseText.url;				
						$.each(data, function(x, y) {
							_tmp_html += '<option value="'+y.id+'">'+y.title+'('+y.name+')'+'</option>';
						});
						parent.$("#<?php echo I('get.o');?>").html(_tmp_html);
						parent.layer.close(index);
					} 
				});
			}else{
				parent.layer.open({
					type:0, 
					icon:2,
					content:responseText.info
				});
			}
		}else{
			parent.layer.msg('服务器错误');
		}
	} 

	function showRequest(){
		$('#iframForm button').attr("disabled","disabled");
		$('#iframForm input').attr("disabled","disabled");
		load = parent.layer.load(0,{shade: [0.7, '#000000']});
	}
})
</script>

</head>
<body>
<div class="iframeBox">
	<form id="iframForm" class="layui-form" method="post" action="<{:U('Node/edit')}>">		
		<php>if($list['pid']>0){</php>
		<div class="layui-form-item">
			<label class="layui-form-label">父节点</label>
			<div class="layui-input-static">
				<{$pname}>
			</div>
		</div>
		<php>}</php>
		
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label"><{$name}>描述</label>
			<div class="layui-input-inline">
				<input type="text" name="title" class="layui-input" lay-verify="required" value="<{$list['title']}>"  placeholder="中文描述">
			</div>
			<label class="layui-form-label"><{$nodeName}>名称</label>
			<div class="layui-input-inline">
				<input type="text" name="name" class="layui-input" lay-verify="required" value="<{$list['name']}>" placeholder="填写<{$nodeName}>名称">
			</div>			
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-inline">
				<input type="radio" name="status" value="1" title="开启" <php>if($list['status']==='1')echo checked;</php>>
				<input type="radio" name="status" value="0" title="关闭" <php>if($list['status']==='0')echo checked;</php>>
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">归属</label>
			<div class="layui-input-inline">
				<select name="data" id="data" lay-verify="required">
				<option value="">==请选择==</option>
				<volist name="leftMenu" id="vo">
				<option value="<{$vo.title}>"><{$vo.title}></option>
				</volist>
				</select>
			</div>
		</div>		

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">菜单</label>
			<div class="layui-input-inline">
				<input type="radio" name="display" value="1" title="显示" <php>if($list['display']==='1')echo checked;</php>>
				<input type="radio" name="display" value="0" title="隐藏" <php>if($list['display']==='0')echo checked;</php>>
			</div>

			<label class="layui-form-label">图标</label>
			<div class="layui-input-inline">
				<input type="text" name="icon" value="<{$list.icon}>" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">备注</label>
			<div class="layui-input-block">
				<input type="text" name="remark" class="layui-input" value="<{$list['remark']}>">
			</div>
		</div>

		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">排序</label>
			<div class="layui-input-inline">
				<input type="text" name="sort" class="layui-input" value="<{$list['sort']}>" placeholder="必填" lay-verify="number">
			</div>
		</div>
		<input type="hidden" name="model" value="<{$mid}>">
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="">编辑<{$nodeName}></button>
			</div>
		</div>
		<input type="hidden" name="pid" value="<{$list['pid']}>" />
		<input type="hidden" name="level" value="<{$list['level']}>" />
		<input type="hidden" name="id" value="<{$list['id']}>" />
		<input type="hidden" name="dosubmit">
	</form>
</div>
<script>
$("#data").val("<{$list.data}>");
</script>
</body>
</html>